package com.cd.controller;

import com.cd.common.controller.BaseController;
import com.cd.common.domain.AjaxResult;
import com.cd.common.domain.SysUser;
import com.cd.system.service.SysConfigService;
import com.cd.system.service.UserService;
import com.cd.common.util.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 注册验证
 *
 * @author lqq
 */
@RestController
public class SysRegisterController extends BaseController {
    @Autowired
    private UserService userService;

    @Autowired
    private SysConfigService configService;

    @PostMapping("/register")
    public AjaxResult register(@RequestBody SysUser user) {
        String msg = userService.register(user);
        return StringUtils.isEmpty(msg) ? success() : error(msg);
    }
}
